package com.like.myapplication0;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {
    private FaceLoadingView faceview;
    private float progress = 0f;
    private WaveView mWaveView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //1.加载动画
//        setContentView(new LoadingView(this));
        //2.飞机效果
//        setContentView(new PathMeasureView(this));
         //3.DrawBitmap
//        setContentView(new DrawBitmap(this));
         //4.笑脸
        setContentView(R.layout.activity_main);
        faceview = (FaceLoadingView) findViewById(R.id.faceview);
        faceview.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        while (progress <= 100){
                            progress += 2;
                            faceview.setProgress(progress / 100);
                            try {
                                Thread.sleep(100);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                        }

                    }
                }).start();

            }
        });

        //4.小船滑行
//        mWaveView = new WaveView(this);
//        setContentView(mWaveView);
//        mWaveView.startAnimation();
    }
}
